package org.hagopa.games.moneypool.msgs.ContentTypes;


public enum UpdateTypeEnum {
	PROPERTY_UPDATE (1, "Property"),
	PLAYER_UPDATE   (2, "Player"),
	DIES_UPDATE     (3, "DiesThrowing");
	
	private int idx;
	private String name = null;
	 UpdateTypeEnum(int index, String name) {
		this.idx = index;
	}
	 public int idx()
	{
		return this.idx;
	}
	public String getName()
	{
		return this.name;
	}
	public static UpdateTypeEnum getEnum(int idx)
	{
		switch (idx){
		case 1:
			return PROPERTY_UPDATE;
		case 2:
			return PLAYER_UPDATE;
		case 3:
			return DIES_UPDATE;
		
		default:
				return null;
		}
		
	}
	public static UpdateTypeEnum getEnum(String name)
	{
		if(name.compareTo("Property") == 0)
					return PROPERTY_UPDATE;
		else if(name.compareTo("Player") == 0)
			return PLAYER_UPDATE;
		else if(name.compareTo("DiesThrowing") == 0)
			return DIES_UPDATE;
		else
			return null;
	
	}
}
